#include<string.h>
#include <boost/log/trivial.hpp>
#include <boost/log/sources/severity_channel_logger.hpp>

#define LOG_DEBUG(Obj) BOOST_LOG_SEV(Obj.GetLog(), boost::log::trivial::debug) << "file:" << __FILE__ << "(" << __LINE__ << "):" << __FUNCTION__ << ":"
#define LOG_INFO(Obj) BOOST_LOG_SEV(Obj.GetLog(), boost::log::trivial::info) << "file:" << __FILE__ << "(" << __LINE__ << "):" << __FUNCTION__ << ":"
#define LOG_WARN(Obj) BOOST_LOG_SEV(Obj.GetLog(), boost::log::trivial::warning) << "file:" << __FILE__ << "(" << __LINE__ << "):" << __FUNCTION__ << ":"
#define LOG_ERR(Obj) BOOST_LOG_SEV(Obj.GetLog(), boost::log::trivial::error) << "file:" << __FILE__ << "(" << __LINE__ << "):" << __FUNCTION__ << ":"
#define LOG_FATAL(Obj) BOOST_LOG_SEV(Obj.GetLog(), boost::log::trivial::fatal) << "file:" << __FILE__ << "(" << __LINE__ << "):" << __FUNCTION__ << ":"


class Logger
{
	public:
		Logger(const std::string& sink);
		~Logger();

		boost::log::sources::severity_channel_logger<boost::log::trivial::severity_level, std::string>& GetLog()
		{
			return m_log;
		}

	private:
		void Init(const std::string& log_path);

		boost::log::sources::severity_channel_logger<boost::log::trivial::severity_level, std::string> m_log;
		std::string m_SinkName;
};
